
/* <<< COPYRIGHT START >>>
 * Copyright 2006-Present OxygenSoftwareLibrary.com
 * Licensed under the GNU Lesser General Public License.
 * http://www.gnu.org/licenses/lgpl.html
 * 
 * @author: Ugorji Dick-Nwoke
 * <<< COPYRIGHT END >>>
 */


package oxygen.markup.indexing;

import java.io.StringReader;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;

import oxygen.markup.MarkupConstants;
import oxygen.markup.MarkupLink;
import oxygen.markup.MarkupParser;
import oxygen.markup.MarkupParserBase;
import oxygen.markup.MarkupRenderContext;
import oxygen.markup.MarkupRenderEngine;
import oxygen.util.StringUtils;

public class MarkupIndexingParser {
  private MarkupIndexingParserBase mbase;
  private MarkupParser mp;
  
  public MarkupIndexingParser(MarkupParser mp0, 
                              MarkupRenderContext rc0, MarkupRenderEngine re0, 
                              String txtsrc0, List _tokenstrings, HashSet _hs) throws Exception {
    mp = mp0;
    mbase = new MarkupIndexingParserBase(mp, _tokenstrings, _hs);
    mbase.setRenderContext(rc0);
    mbase.setRenderEngine(re0);    
    mbase.setTextSourceName(txtsrc0);

    mp.setMarkupParserBase(mbase);    
  }

  public MarkupIndexingParser(MarkupParser mp0, 
                              MarkupIndexingParserBase mbase0) throws Exception {
    mp = mp0;
    mbase = mbase0;
    mp.setMarkupParserBase(mbase);    
  }
  
  public void markupToHTML() throws Exception {
    mp.markupToHTML();
  }
  
  boolean isCensoredWord(String s) {
    return mbase.getRenderContext().isCensoredWord(s);
  }  
  
}

